# common_pods
# common_networking_pods
# common_json_pods
# common_layout_pods
# common_image_pods
# common_zip_pods

# common_iOS_pods
# common_macOS_pods

# live_OS_pods
# live_iOS_pods
# live_macOS_pods

workspace 'TT.xcworkspace'

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      if
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 11.0
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
      end
      
      xcconfig_path = config.base_configuration_reference.real_path
      xcconfig = File.read(xcconfig_path)
      xcconfig_mod = xcconfig.gsub(/-framework "TwitterCore"/, "")
      File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
    end
  end
end

# config.build_settings['MACOSX_DEPLOYMENT_TARGET']. < 10.9
# config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.9

# 公共
def common_pods
  
  pod 'YYText'
  pod 'TwitterKit'
  # pod 'lottie-ios', '~>3.1.9'
  # pod 'RxSwift', '~>5.1.1'
  # pod 'RxCocoa', '~>5.1.1'
end

## 工具
#def tools_pods
#  # pod 'AliyunOSSiOS'
#end

# 网络
def common_networking_pods
  pod 'AFNetworking'
  pod 'Alamofire'
  #  pod 'Moya/RxSwift'
end

# json <-> model
def common_json_pods
  #pod 'KakaJSON'
  #pod 'MJExtension'
  pod 'HandyJSON', '~>5.0.4-beta'
end

# UI布局
def common_layout_pods
  pod 'SnapKit'
  pod 'Masonry'
end

# 图片加载器
def common_image_pods
  pod 'Kingfisher'
  pod 'SDWebImage'
  pod 'YYImage'
  pod 'GPUImage'
end

# 广告
def common_ad_pods
  pod 'Google-Mobile-Ads-SDK'
  pod 'FBAudienceNetwork'
  pod 'GoogleMobileAdsMediationFacebook'
end

## zip压缩/ 解压缩
#def common_zip_pods
#  pod 'SSZipArchive'
#  pod 'ZipArchive'
#end

## live OS公用
#def live_OS_pods
#end

## iOS live专用
#def live_iOS_pods
#  pod 'NIMSDK'
#  pod 'AgoraRtcEngine_iOS', '~>2.9.0.107'
#  pod 'ZegoLiveRoom', '~>1.20.7.9'
#  pod 'AgoraRtm_iOS', '~>1.4.0'
#  pod 'PanoRtc_iOS'
#end

## macOS Service 组件专用
#def live_service_macOS_pods
#  pod 'AgoraRtcEngine_macOS','2.9.0.106'
#  pod 'AgoraSig_macOS', '1.4.0'
#  pod 'AgoraRtm_macOS', '1.4.0'
#end

## macOS live专用
#def live_macOS_pods
#  pod 'PanoRtc_macOS'
#end

# iOS专用
def common_iOS_pods
  #  # pod 'AliPlayerSDK_iOS'
  pod 'MJRefresh'
  pod 'MBProgressHUD'
  pod 'SVProgressHUD'
  pod 'Toast', '~> 4.0.0'
  #  pod 'WebViewJavascriptBridge', '~>6.0'
  #   pod 'YYFPSLabel'
end

## macOS专用
#def common_macOS_pods
#
#end

### 组件引用
## TTBLL
#target 'TTBLL-iOS' do
#  use_frameworks!
#
#  project 'TTBLL/TTBLL.xcodeproj'
#
#  common_json_pods
#end
#
#target 'TTBLL-macOS' do
#  use_frameworks!
#
#  project 'TTBLL/TTBLL.xcodeproj'
#
#  common_json_pods
#end

# TTCOM
target 'TTCOM-iOS' do
  use_frameworks!
  
  project 'TTCOM/TTCOM.xcodeproj'
  
  common_json_pods
end
#
#target 'TTCOM-macOS' do
#  use_frameworks!
#
#  project 'TTCOM/TTCOM.xcodeproj'
#
#  common_json_pods
#end

def hawkeye
  pod 'MLeaksFinder', :configurations => 'Debug'
#  pod 'MTHawkeye','~> 0.12.4', :configurations => 'Debug'
#  pod 'FLEX' ,' ~> 4.1.1', :configurations => ['Debug']
#  pod 'FBRetainCycleDetector', :configurations => ['Debug']
  pod 'fishhook', :configurations => ['Debug']
  pod 'CocoaLumberjack','3.6.0', :configurations => ['Debug']
  # pod 'MTGLDebug', :configurations => ['Debug']
  
  pod 'MTAppenderFile', :configurations => ['Debug']
end

## TTServer
#target 'TTServer-iOS' do
#  use_frameworks!
#
#  project 'TTServer/TTServer.xcodeproj'
#
#  common_json_pods
#end

#target 'TTServer-macOS' do
#  use_frameworks!
#
#  project 'TTServer/TTServer.xcodeproj'
#
#  common_json_pods
#end

# TTService
#target 'TTService-iOS' do
#  use_frameworks!
#
#  project 'TTService/TTService.xcodeproj'

#  tools_pods
#  common_json_pods
#  common_networking_pods
#  live_OS_pods
#  live_iOS_pods
#end

#target 'TTService-macOS' do
#  use_frameworks!
#
#  project 'TTService/TTService.xcodeproj'
#
#  tools_pods
#  common_json_pods
#  common_networking_pods
#  live_OS_pods
#  live_macOS_pods
#  live_service_macOS_pods
#end

## TTCoreData
#target 'TTCoreData-iOS' do
#  use_frameworks!
#
#  project 'TTCoreData/TTCoreData.xcodeproj'
#
#  common_json_pods
#end

#target 'TTCoreData-macOS' do
#  use_frameworks!
#
#  project 'TTCoreData/TTCoreData.xcodeproj'
#
#  common_json_pods
#end

## 项目引用
# TTProduct-iPhone
target 'iPhone' do
  platform :ios, 11.0
  use_frameworks!
  inhibit_all_warnings!
  
  project 'TTProduct-iPhone/TTProduct-iPhone.xcodeproj'
  common_pods
  common_iOS_pods
  common_layout_pods
  common_image_pods
  common_json_pods
  common_ad_pods
end

### 项目引用
## TTProduct-iPad
#target 'TTProduct-iPad' do
#  platform :ios, 10.0
#  use_frameworks!
#  inhibit_all_warnings!
#
#  project 'TTProduct-iPad/TTProduct-iPad.xcodeproj'
#
#  common_pods
#  tools_pods
#  common_networking_pods
#  common_json_pods
#  common_layout_pods
#  common_image_pods
#  common_zip_pods
#
#  common_iOS_pods
#
#  live_OS_pods
#  live_iOS_pods
#end

### 项目引用
## TTProduct-macOS
#target 'TTProduct-macOS' do
#  platform :macos, 10.12
#
#  use_frameworks!
#  inhibit_all_warnings!
#
#  project 'TTProduct-macOS/TTProduct-macOS.xcodeproj'
#
#  common_pods
#  tools_pods
#  common_networking_pods
#  common_json_pods
#  common_layout_pods
#  common_image_pods
#  common_zip_pods
#
#  common_macOS_pods
#  live_OS_pods
#  live_macOS_pods
#end

## 项目引用
## TTProduct-macOS
#target 'TTTest-macOS' do
#  platform :macos, 10.12
#
#  use_frameworks!
#  inhibit_all_warnings!
#
#  project 'TTTest/TTTest.xcodeproj'
#
#  common_pods
#  common_networking_pods
#  common_json_pods
#  common_layout_pods
#  common_image_pods
#  common_zip_pods
#
#  common_macOS_pods
#  live_OS_pods
#  live_macOS_pods
#end
